<template>
  <div>
    <custom-table
      :columns="columns"
      :query="queryParams"
      v-bind="$attrs"
      v-on="listeners"
      @tap-head-btn="onTapHeadBtn"
      @tap-row-btn="onTapRowBtn"
      @row-dblclick="onRowDbClick"
    >
    </custom-table>
  </div>

</template>

<script>
import tableMixin from '@/utils/mixin/custom-table'
// import mock from '@/utils/mixin/mock'

// var Mock = require('mockjs')

export default {
  data() {
    return {
      columns: [
        { name: '标题', field: 'title', type: 'tag' },
        { name: '副标题', field: 'Subtitle', type: 'tag' },
        { name: '主图', field: 'image', type: 'image' },
        { name: '内容', field: 'content', type: 'content', opts: { html: true } },
        { name: '状态', field: 'status', label: true, type: this.checkAuth('change') ? 'switch' : 'tag', opts: {} },
        // { name: '房号', field: 'number', width: 150, type: 'tag' },
        // { name: '状态', field: 'status', label: true, type: this.checkAuth('change') ? 'switch' : 'tag', opts: {} },
        // { name: '状态', field: 'status', type: 'tag', opts: {} },
        { name: '添加时间', field: 'create_time' }
      ]
    }
  },
  components: {},
  mixins: [
    tableMixin
    // mock
  ],
  computed: {
    rowBtn() {
      return []
    }
  },

  filters: {},
  created() {
  },
  methods: {
    /*
    onLoad() {
      var data = Mock.mock({
        // 属性 list 的值是一个数组，其中含有 1 到 10 个元素
        'list|20': [{
          // 属性 id 是一个自增数，起始值为 1，每次增 1
          'id|+1': 1,
          'number|1-999': 1,
          'title': '@ctitle',
          'content': '@cparagraph',
          'create_time': '@now'
        }]
      })

      console.log('mock', data)

      this.setMockData(data)
    }
    */
  }
}
</script>

<style lang="scss">

</style>
